package com.umeox.watch.moto.chat.ui

import android.content.Intent
import android.os.Bundle
import android.view.View
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.umeox.moto.common.decoration.VerticalItemDecoration
import com.umeox.moto.common.log.Logger
import com.umeox.moto.common.ui.BaseActivity
import com.umeox.moto.watch.themes.app.ThemeAppCompatActivity
import com.umeox.watch.moto.chat.R
import com.umeox.watch.moto.chat.adapter.EmojiAdapter
import com.umeox.watch.moto.chat.adapter.QuickReplyAdapter
import com.umeox.watch.moto.chat.ui.WatchMessageActivity.Companion.EXTRA_PHRASE
import com.umeox.watch.moto.chat.utils.EmoticonConstants
import me.everything.android.ui.overscroll.OverScrollDecoratorHelper

class PhraseActivity : ThemeAppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.quick_reply_layout)


        val quickReplyRv = findViewById<RecyclerView>(R.id.rv_qucik_reply)
        val quickReplyAdapter = QuickReplyAdapter(this)
        quickReplyRv.adapter = quickReplyAdapter
        quickReplyRv.layoutManager = LinearLayoutManager(this)
        quickReplyRv.addItemDecoration(VerticalItemDecoration(8))

        OverScrollDecoratorHelper.setUpOverScroll(
            quickReplyRv,
            OverScrollDecoratorHelper.ORIENTATION_VERTICAL
        )
        quickReplyAdapter.setOnItemClickListener {
            val data = Intent()
            data.putExtra(EXTRA_PHRASE, it)
            setResult(RESULT_OK, data)
            finish()
        }

    }

}
